package test

import (
	"blog/utils/tools"
	"fmt"
	"time"
)

// 通过绝对路径和相对路径写入文件
func saveFileName() {
	filePath := "D:\\study\\gin_web\\golang_study\\blog\\runtime\\log\\"
	filePath = "runtime/log/"
	fileName := fmt.Sprintf(filePath+"log_%d.txt", time.Now().Unix())
	fmt.Println(fileName)
	k, e := tools.OpenFileOrCreateFile(fileName)
	if e != nil {
		fmt.Println(e)
	}
	fmt.Println(k, "ok")
}
